<div id="toolbar" >
  <div class="right-toolbar">
  <a title="Thêm bài viết mới">
  <button onclick="location.href='<?php echo $this->_baseUrl;?>/admin/articles/create'">
  <img src="<?php echo $this->_baseUrl;?>/public/images/web/insert.png" height="32px" width="32px"/>
  <span><p>Thêm mới</p></span>
  </button>
  </a>
  </div>
  <div class="left-toolbar">
  <img src="<?php echo $this->_baseUrl;?>/public/images/web/articles.png" height="48px" width="48px"/>
  <span>Quản lý bài viết</span>
  </div>
</div>

<div id="box-content">
 <div id="box-content1">
    <div id="box-content-top">
       <div style="width: 5%;">STT</div>
       <div style="width: 70%;">Tiêu đề</div>
       <div style="width: 18%;">Thể loại</div>
       <div style="border-style: none;width: 5%;">Xóa</div>
    </div>
    <div id="box-content-middle">
    
    <script language="javascript">
	function del(id){
		if(confirm('Bạn có muốn xóa bài viết này ?')){
			location.href='<?php echo $this->_baseUrl;?>/admin/articles/delete/id/'+id;
		}
	}
   </script>
   
   
   <?php 
   if($this->list != null)
     {
       $sum = count($this->list); 
       for( $i = 0; $i < $sum ; $i++)
       {
   ?>
        <div class="content-row <?php if($i % 2 == 0) echo "row0"; else echo "row1";?>">
            <div style="width: 5%;"><?php echo $i+1;?></div>
            <div style="width: 70%;">
                <a href="<?php echo $this->_baseUrl;?>/admin/articles/edit/id/<?php echo $this->list[$i]['article_id'];?>">
                  <?php echo $this->list[$i]['title'];?>
                </a>
            </div>
            <div style="width: 18%;">
            <?php
                switch ($this->list[$i]['group_index']) {
                   case 0:
                         echo "Chưa xác định";
                         break;
                   case 1:
                          echo "Giới thiệu";
                          break;
                  case 2:
                         echo "Hướng dẫn";
                         break;
                  case 3:
                         echo "Download";
                         break;       
              }
            ?>
            </div>
            <div style="border-style: none;width: 5%;">
                  <a onclick="del(<?php echo $this->list[$i]['article_id'];?>);" title="Xóa" style="padding-top: 5px;">
                  <img src="<?php echo $this->_baseUrl;?>/public/images/web/delete.png" height="16px" width="16px"/>
                  </a>
            </div>
      </div>
   <?php     
       }  
     }
   ?>
    </div>
    <div id="box-content-bottom"></div>
 </div>
</div>